<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>水平聚合柱状图</title>
    <script src="../../echarts.min.js"></script>
</head>
<body>
    <div id="main" style="width: 800px;height: 400px;"></div>
</body>
<script>
    let myechart = echarts.init(document.getElementById("main"))
    let option = {
        title:{
            text:"水平聚合柱状图",
            left:"center"
        },
        xAxis:{type:"value"},
        yAxis:{
            type:'category',
            data:["商场A","商场B","商场C","商场D","商场E","商场F"]
        },
        legend:{
            left:"right",
            data:["产品A","产品B"]
        },
        series:[
            {
                name:"产品A",
                data:[100,150,120,90,50,130,110],
                type:"bar",
                label:{
                    show:true,
                    position:"right"
                }
            },
            {
                name:"产品B",
                data:[120,130,110,70,60,110,140],
                type:"bar",
                label:{
                    show:true,
                    position:"right"
                }
            }
        ]
    }
    myechart.setOption(option)
</script>
</html>